<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initRoute(){
        $front = Zend_Controller_Front::getInstance();
        $front->addControllerDirectory(APPLICATION_PATH . "/modules/default/controllers");
//         $front->setControllerDirectory(array(
//                 'default'=>APPLICATION_PATH . "/modules/default/controllers",
//                 'admin'  =>APPLICATION_PATH . "/modules/admin/controllers",
//         ));
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routers.ini', 'production');
        $router = new Zend_Controller_Router_Rewrite();
        $router = $router->addConfig($config, 'routes');
        $front->setRouter($router);
        return $front;
    }

    public function _initSession(){
        Zend_Session::start();
    }
	protected function _initAutoload(){
		$autoload=new Zend_Application_Module_Autoloader(array(
				'namespace'=>'',
				'basePath'=>dirname(__FILE__)
		));	

		$acl = new Application_Model_AclLibrary();
		$front = Zend_Controller_Front::getInstance();
		$front->registerPlugin(new MyLibrary_AclPlugin($acl));
		return $autoload;
	}
// 	protected function _initFrontcontroller(){
// 	    $front = Zend_Controller_Front::getInstance();
// 	    $front->addModuleDirectory(APPLICATION_PATH . '/modules');
	    
// 	    $acl = new Application_Model_AclLibrary();
// 	    $front->registerPlugin(new MyLibrary_AclPlugin($acl));// ten class plugin
	     
// 	    return $front;
// 	}
	/*protected function _initFrontController(){
//           $config = new Zend_Config_Ini(APPLICATION_PATH .'/configs/routers.ini', 'production');
//           $opRouter = new Zend_Controller_Router_Rewrite();
//           $router = $opRouter->addConfig($config, 'routes');
//           $front = Zend_Controller_Front::getInstance();
//           $front->setRouter($router);
	    $front = Zend_Controller_Front::getInstance();
	    $front->setControllerDirectory(APPLICATION_PATH ."/modules/default/controllers");
	     
	    $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routers.ini', 'production');
	    $router = new Zend_Controller_Router_Rewrite();
	    
	    $router = $router->addConfig($config, 'routes');
	    
	    $front->setRouter($router);
	    
	    return $front;
    }*/
    
    /*protected function _initFrontController(){
    
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routers.ini', 'production');
        $objRouter = new Zend_Controller_Router_Rewrite();
        $router = $objRouter->addConfig($config,'routes');
        $front = Zend_Controller_Front::getInstance();
        $front->setRouter($router);
    }*/
}

